package computer;

/*
 * 测试类：为计算机安装不同的CPU、硬盘、内存，并输出其相关信息
 */

public class Test {
	public static void main(String[] args) {
		Computer computer = new Computer();
		CPU cpu = null;
		EMS ems = null;
		HardDisk hardDisk = null;

		// 为计算机安装IntelCPU,金士顿内存，西部数据硬盘，并输出相关信息
		cpu = new IntelCPU();
		ems = new KingstonEMS();
		hardDisk = new WDHardDisk();
		computer.setCpu(cpu);
		computer.setEms(ems);
		computer.setHardDisk(hardDisk);
		computer.printInfo();

		System.out.println();

		// 为计算机安装AMDCPU,联想内存，希捷硬盘，并输出相关信息
		cpu = new AMDCPU();
		ems = new LenovoEMS();
		hardDisk = new SEAGATEHardDisk();
		computer.setCpu(cpu);
		computer.setEms(ems);
		computer.setHardDisk(hardDisk);
		computer.printInfo();

		System.out.println();

		// 为计算机安装IntelCPU,联想内存，希捷硬盘，并输出相关信息
		cpu = new IntelCPU();
		computer.setCpu(cpu);
		computer.printInfo();
	}
}
